import axiosInstance from '@/utils/request'
import { ILogin, IResponse } from '@/types/type'

export const login = (params: ILogin): Promise<IResponse> => {
  return axiosInstance.request({
    baseURL: 'http://www.aircity.ac.cn:6002',
    url: '/cim/open/bigScreen/auth/login',
    method: 'post',
    params
  })
}

export const getCode = (token: string): Promise<IResponse> => {
  return axiosInstance.request({
    baseURL: 'http://www.aircity.ac.cn:5570',
    url: '/cim/user/menuByProjectIdAndToken',
    headers: {
      Authorization: 'bearer ' + token
    },
    data: { projectId: '76dcff05-b883-4706-b684-005cc8abdf01' }
  })
}
